package com.sys.db.action;

import java.util.List;


import org.apache.struts2.json.annotations.JSON;

import com.opensymphony.xwork2.ActionSupport;
import com.sys.db.manager.DefJobTypeParaManager;
import com.sys.pojo.DefJobTypePara;

public class DefJobTypeParaAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List list=null;
	private DefJobTypeParaManager defJobTypeParaManager;
	private DefJobTypePara defJobTypePara;
	private boolean success=true;
	private String message;
	private String datas;
	private String ids;
	private int count;
	private String start;
	private String limit;
	/**
	 * 列出所有jobType
	 * @return
	 */
	public String listJobTypeParas(){
		try {
			List listAll=defJobTypeParaManager.findAll();
			list=defJobTypeParaManager.findByPage(new Integer(start), new Integer(limit));
			count=listAll.size();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}
	/**
	 * 保存页面修改/新增数据
	 */
	public String saveJobTypeParas(){
		try {
			defJobTypeParaManager.saveOrUpdate(datas);
		} catch (Exception e) {
			success=false;
			message=e.getMessage();
			e.printStackTrace();
		}
		
		return SUCCESS;
	}
	/**
	 * 删除选择的数据
	 */
	public String deleteJobTypeParas(){
		try {
			defJobTypeParaManager.deleteByIds(ids);
		} catch (Exception e) {
			success=false;
			message=e.getMessage();
			e.printStackTrace();
		}
		
		return SUCCESS;
	}
	
	
	public List getList() {
		return list;
	}
	public void setList(List list) {
		this.list = list;
	}
	@JSON(serialize=false)
	public DefJobTypeParaManager getDefJobTypeParaManager() {
		return defJobTypeParaManager;
	}
	public void setDefJobTypeParaManager(DefJobTypeParaManager defJobTypeParaManager) {
		this.defJobTypeParaManager = defJobTypeParaManager;
	}

	public DefJobTypePara getDefJobTypePara() {
		return defJobTypePara;
	}

	public void setDefJobTypePara(DefJobTypePara defJobTypePara) {
		this.defJobTypePara = defJobTypePara;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getDatas() {
		return datas;
	}

	public void setDatas(String datas) {
		this.datas = datas;
	}
	public String getIds() {
		return ids;
	}
	public void setIds(String ids) {
		this.ids = ids;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public String getStart() {
		return start;
	}
	public void setStart(String start) {
		this.start = start;
	}
	public String getLimit() {
		return limit;
	}
	public void setLimit(String limit) {
		this.limit = limit;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}

	
}
